package cn.like.common.context.redisKey;

import cn.like.redis.RedisKey;

/**
 * desc: 认证相关的redis key <br>
 * details:
 *
 * @author like 980650920@qq.com
 * @date 2021-07-08 13:59:00
 * @see RedisKey
 */
public enum AuthRedisKey implements RedisKey {

    /**
     * 验证码缓存键 string
     * <pre>
     *  captcha:
     *  	key1: 1323
     *  	key2: 33as
     * </pre>
     */
    captcha_cache_key("captcha:{0}"),
    /**
     * 权限缓存键 hash
     * <pre>
     *       permissions_user:{userId1:xxx}
     *                       :{userid2:xxx}
     * </pre>
     */
    permissions_cache_key("permissions_user"),
    /**
     * 用户角色缓存键 hash
     * <pre>
     *      role_user:{userId1:xxx}
     *               :{userId2:xxx}
     * </pre>
     */
    role_cache_key("role_user")

    ;

    private final String keyStyle;

    AuthRedisKey(String keyStyle) {
        this.keyStyle = keyStyle;
    }

    @Override
    public String keyStyle() {
        return keyStyle;
    }
}
